package MyByteStream2;

import java.io.FileInputStream;
import java.io.IOException;

public class ByteStreamDemo4 {
    public static void main(String[] args) throws IOException {
        FileInputStream fis = new FileInputStream("csb.txt");
        byte[]bytes = new byte[2];
        int len1 = fis.read(bytes);
        System.out.println(len1);
        String s1 = new String(bytes,0,len1);
        System.out.println(s1);
        int len2 = fis.read(bytes);
        System.out.println(len2);
        String s2 = new String(bytes,0,len2);
        System.out.println(s2);
        int len3 = fis.read(bytes);
        System.out.println(len3);
        String s3 = new String(bytes,0,len3);
        System.out.println(s3);
    }
}
